export function addParagraphs() {

  Word.run(async function (ctx) {

    // Queue a command to add a paragraph at the end of the document. Set the style on the paragraph.
    var myPar = ctx.document.body.insertParagraph("Timeline", "end");
    myPar.style = "Heading 2";

    var myPar2 = ctx.document.body.insertParagraph("The Services shall commence on July 31, 2015, and shall continue through July 29, 2015.", "end");
    myPar2.style = "Normal";
    console.log('批量添加2')
    var myPar3 = ctx.document.body.insertParagraph("Project Costs by Phase", "end");
    myPar3.style = "Heading 2";

    // Queue a command to add a paragraph at the end of the document. Set the style on the paragraph and wrap the paragraph
    // in a content control with the title of "ProjectCosts".
    var myPar4 = ctx.document.body.insertParagraph("<Add Project Costs Here>", "end");
    myPar4.style = "Normal";
    myPar4.font.highlightColor = "#FFFF00";
    var myContentControl = myPar4.insertContentControl();
    myContentControl.title = "ProjectCosts";

    var myPar5 = ctx.document.body.insertParagraph("Project Team", "end");
    myPar5.style = "Heading 2";
    myPar5.font.highlightColor = "#FFFFFF";

    // Queue a command to insert a page break at the end of the document.
    ctx.document.body.insertBreak("page", "End");

    var myPar6 = ctx.document.body.insertParagraph("Terms of Work", "end");
    myPar6.style = "Heading 1";

    var myPar7 = ctx.document.body.insertParagraph("Contractor shall provide the Services and Deliverable(s) as follows:", "end");
    myPar7.style = "Normal";

    var myPar8 = ctx.document.body.insertParagraph("Out-of-Pocket Expenses / Invoice Procedures", "end");
    myPar8.style = "Heading 2";

    var myPar9 = ctx.document.body.insertParagraph("Client will be invoiced monthly for the consulting services and T&L expenses. Standard Contractor invoicing is assumed to be acceptable. Invoices are due upon receipt. \n client will be invoiced all costs associated with out-of-pocket expenses (including, without limitation, costs and expenses associated with meals, lodging, local transportation and any other applicable business expenses) listed on the invoice as a separate line item. Reimbursement for out-of-pocket expenses in connection with performance of this SOW, when authorized and up to the limits set forth in this SOW, shall be in accordance with Client’s then-current published policies governing travel and associated business expenses, which information shall be provided by the Client Project Manager. The limit of reimbursable expenses pursuant to this SOW is estimated to be 15% of the fees unless otherwise authorized in writing and agreed to by both parties via the project change control procedure outlined within. \n Invoices shall be submitted monthly in arrears, referencing this Client’s SOW Number to the address indicated above. Each invoice will reflect charges for the time period being billed and cumulative figures for previous periods. Terms of payment for each invoice are due upon receipt by Client of a proper invoice. Contractor shall provide Client with sufficient details to support its invoices, including time sheets for services performed and expense receipts and justifications for authorized expenses, unless otherwise agreed to by the parties. Payments for services invoiced that are not received within 30-days from date of invoice will be subject to a 5% penalty per calendar month.", "end");
    myPar9.style = "Normal";


    // Synchronize the document state by executing the queued commands,
    // and returning a promise to indicate task completion.

    return ctx.sync()
      .then(function () {
        console.log('添加完')
        // handleSuccess();
      })
      .catch(function (error) {
        // handleError(error);
      })
  });
}
